package com.tongji.diy.model.furniturePlacementOptimization.assembleComplement
{
	import com.tongji.diy.model.furniturePlacementOptimization.OptimizationParameter;

	//坐具类
	public class Seat extends SLbase
	{
		public function Seat(furnitureIndex:int, furnitureClass:int, aganistWall:Boolean, length:Number = 0, width:Number = 0, height:Number = 0,peopleNum:int = 0,priorList:Vector.<FurnitureBase> = null)
		{
			super(furnitureIndex,furnitureClass, aganistWall,length, width, height, peopleNum, priorList);
			buildAccessibleBox();
		}
		
		override public function set angle(angle:Number):void
		{
			super.angle = angle;
			buildAccessibleBox();
		}
		
		override public function set x(x:Number):void
		{
			super.x = x;
			buildAccessibleBox();
		}
		
		override public function set y(y:Number):void
		{
			super.y = y;
			buildAccessibleBox();
		}
		
		private function buildAccessibleBox():void
		{
			_accessibleBox = buildAccessOBB(x,
				y - (OptimizationParameter.ACCESS_DIS_FOR_BEDDING)/2,
				width,
				length + OptimizationParameter.ACCESS_DIS_FOR_BEDDING); 
			
			//test
//			_accessibleBox = buildAccessOBB(x,
//				y + (OptimizationParameter.ACCESS_DIS_FOR_BEDDING)/2,
//				width,
//				length + OptimizationParameter.ACCESS_DIS_FOR_BEDDING); 
		}
	}
}